package ttu.idu0080.ryhm103_offerService;

import java.util.Random;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "offer", propOrder = {
    "offer_id",
    "offer_price",
    "delivery_time",
})
public class Offer {
	protected String offer_id=generateString(new Random(), "RI1234567890", 8);
	protected double offer_price;
	protected int delivery_time=(int)(Math.random() *7+1);
	
	
	public String getOffer_id() {
		return offer_id;
	}

	public double getOffer_price() {
		return offer_price;
	}

	public void setOffer_price(double offer_price) {
		this.offer_price = offer_price;
	}

	public int getDelivery_time() {
		return delivery_time;
	}
	
	public static String generateString(Random rng, String characters, int length)
	{
	    char[] text = new char[length];
	    for (int i = 0; i < length; i++)
	    {
	        text[i] = characters.charAt(rng.nextInt(characters.length()));
	    }
	    return new String(text);
	}
	
}


